//
//  TTCommitOrderHeaderView.h
//  TaoTuo
//
//  Created by 周晨晔 on 2019/9/23.
//  Copyright © 2019 admin. All rights reserved.
//

#import <UIKit/UIKit.h>
@class TTAddressModel;
@class TTCommitOrderHeaderView;

typedef enum : NSUInteger {
    ReceiveTypeWithMail = 1,
    ReceiveTypeWithSelfTake,
    ReceiveTypeWithSendFactory,
} ReceiveType;

@protocol TTCommitOrderHeaderViewDelegate <NSObject>

// 点击了选择地址
- (void)clickChooseAddressBtnWithHeaderView:(TTCommitOrderHeaderView *_Nullable)headerView;

- (void)clickInsetButton:(UIButton *)insetBtn headerView:(TTCommitOrderHeaderView *_Nullable)headerView;

@end

NS_ASSUME_NONNULL_BEGIN

@interface TTCommitOrderHeaderView : UIView


@property (nonatomic, strong) UITextField *phoneTF;
@property (nonatomic, strong) UITextField *remarkTF;

@property (nonatomic, strong) UITextField *khmTF;
@property (nonatomic, strong) UITextField *contactTF;
@property (nonatomic, strong) UITextField *factoryTF;
@property (nonatomic, strong) UIButton *tapBtn;

@property (nonatomic, readonly, strong, nullable) TTAddressModel *model;

/// 工厂地址
@property (nonatomic, strong, nullable) TTAddressModel *factoryModel;

@property (nonatomic, strong) UIButton *insetBtn;   // 需镶嵌

//@property (nonatomic, readonly, assign) BOOL isMail;  // 是否是邮寄
/// 收货方式
@property (nonatomic, assign) ReceiveType receiveType;

@property (nonatomic, assign) id<TTCommitOrderHeaderViewDelegate> delegate;

+ (instancetype)headerViewWithAddress:(nullable TTAddressModel *)model;
/// 是否要镶嵌
+ (instancetype)headerViewWithAddress:(nullable TTAddressModel *)model isNeedInset:(BOOL)isNeedInset;

/// 回收提交订单用的，不要送厂
+ (instancetype)headerViewIsFromRecyclingWithAddress:(nullable TTAddressModel *)model;

// 是否是邮寄
//- (void)setModel:(TTAddressModel * _Nullable)model isMail:(BOOL)isMail;
 
- (void)setModel:(TTAddressModel * _Nullable)model receiveType:(ReceiveType)receiveType;

@end

NS_ASSUME_NONNULL_END
